from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time

driver = webdriver.Edge()
driver.maximize_window()
driver.get('https://www.126.com/')
time.sleep(2)
driver.switch_to.frame(driver.find_element(By.XPATH,'//iframe[starts-with(@id,"x-URS-iframe17554")]'))
driver.find_element(By.XPATH,'//input[starts-with(@id,"auto-id")]').send_keys('yu2031077871')
time.sleep(2)
driver.find_element(By.NAME,'password').send_keys('Yukaiwen2580')
time.sleep(2)
driver.find_element(By.ID,'dologin').click()
time.sleep(10)
driver.switch_to.default_content()
driver.find_element(By.XPATH,'//*[@id="_mail_component_98_98"]').click()
time.sleep(2)
driver.find_element(By.CLASS_NAME,'nui-editableAddr-ipt').send_keys('2031077871@qq.com')
time.sleep(2)
driver.find_element(By.XPATH,'/html/body/div[2]/div[1]/div[2]/div[1]/section/header/div[2]/div[1]/div/div/input').send_keys('123')
time.sleep(2)
driver.switch_to.frame(driver.find_element(By.CLASS_NAME,'APP-editor-iframe'))
driver.find_element(By.XPATH,'/html/body/div').send_keys('123321')
driver.switch_to.default_content()
time.sleep(2)
driver.find_element(By.CLASS_NAME,'nui-btn-text').click()
time.sleep(5)